package UI;

import java.util.ArrayList;
import java.util.List;

public class ChatSession {
    private String contactName;
    private List<Message> messages;

    public ChatSession(String contactName) {
        this.contactName = contactName;
        this.messages = new ArrayList<>();
    }

    public void addMessage(Message message) {
        messages.add(message);
    }

    public List<Message> getMessages() {
        return messages;
    }

    public String getContactName() {
        return contactName;
    }

    public static class Message {
        private String sender;
        private String content;
        private long timestamp;

        public Message(String sender, String content, long timestamp) {
            this.sender = sender;
            this.content = content;
            this.timestamp = timestamp;
        }

        // Getter方法
        public String getSender() { return sender; }
        public String getContent() { return content; }
        public long getTimestamp() { return timestamp; }
    }
}
